﻿#pragma once

#include <xy/ais/mesh.h>
#include <xy/geom/manifold.h>

namespace xy
{

namespace ais
{

class surface : public mesh
{
  public:
    /**
     * @brief 指针构造
     *
     * @param[in] surface
     */
    explicit surface(std::shared_ptr<geom::surface<3>> surface);

    /**
     * @brief 采样
     * 
     * @param[in] num 
     */
    void sample(std::size_t num);

    /**
     * @brief 获得曲面
     *
     * @return std::shared_ptr<geom::surface<3>>
     */
    std::shared_ptr<geom::surface<3>> sur() const;

    /**
     * @brief 碰撞检测接口
     *
     * @param[in] msg
     * @return true
     * @return false
     */
    bool collision(msg_mouse *msg) override;

    /**
     * @brief 初始化消息
     *
     * @param[in] msg
     */
    void visit(msg_init *msg) override;

  protected:
    std::shared_ptr<geom::surface<3>> m_surface;
};

} // namespace ais

} // namespace xy
